var exec = require('cordova/exec');

// exports.coolMethod = function(arg0, success, error) {
//     exec(success, error, "DDPushTCP", "coolMethod", [arg0]);
// };

module.exports = {
    test: function () {
        exec(null, null, "DDPushTCPManager", "test", []);
    },
    initialize: function (success, error, userId, ip, server_port, push_port) {
        var temp = [];
        temp.push(ip);
        temp.push(server_port);
        temp.push(push_port);
        exec(success, error, "DDPushTCPManager", "initialize", temp);
    },
    pushMsg: function (success, error, type, targetUser, sortData, customData) {
        if (type == "commonMsg") {
            exec(success, error, "DDPushTCPManager", "commonMsg", [targetUser]);
        } else if (type == "sortMsg") {
            exec(success, error, "DDPushTCPManager", "sortMsg", [targetUser, sortData]);
        } else if (type == "customMsg") {
            exec(success, error, "DDPushTCPManager", "customMsg", [targetUser, customData]);
        }
    }
};